var t: integer; dataPid: integer; macro 'Dilate8 front image to new image'; var height,width, inPid, outPid: integer; begin requiresUser('markup',1); t := GetNumber('thresh',t); inpid := pidNumber; GetPicSize(width,height); SaveState; SetNewSize(width,height); MakeNewWindow('Dilated ',inpid:0); outPid := pidNumber; RestoreState; SelectPic(inPid); MakeRoi(1,1,width-2,height-2); SelectPic(outPid); MakeRoi(1,1,width-2,height-2); Dilate8Mark(inPid, outPid, t); end; macro 'Dilate16u front image to new image'; var height,width, inPid, outPid: integer; begin requiresUser('markup',1); t := GetNumber('thresh',t); inpid := pidNumber; GetPicSize(width,height); SaveState; SetNewSize(width,height); MakeNewWindow('Dilated ',inpid:0); outPid := pidNumber; RestoreState; SelectPic(inPid); MakeRoi(2,1,width-4,height-2); SelectPic(outPid); MakeRoi(2,1,width-4,height-2); Dilate16uMark(inPid, outPid, t); end; macro 'Dilate8 front image to same image'; var height,width, inPid, outPid: integer; begin requiresUser('markup',1); t := GetNumber('thresh',t); inpid := pidNumber; GetPicSize(width,height); SaveState; SetNewSize(width,height); MakeNewWindow('Dilated ',inpid:0); outPid := pidNumber; RestoreState; SelectPic(inPid); MakeRoi(1,1,width-2,height-2); SelectPic(outPid); MakeRoi(1,1,width-2,height-2); Dilate8Mark(inPid, outPid, t); SelectAll; Copy; Dispose; SelectPic(inPid); SelectAll; Paste; KillRoi; end; macro 'Dilate8 front image repeatedly'; var height,width, inPid, outPid: integer; begin requiresUser('markup',1); t := GetNumber('thresh',t); inpid := pidNumber; GetPicSize(width,height); SaveState; SetNewSize(width,height); MakeNewWindow('Dilated ',inpid:0); outPid := pidNumber; RestoreState; SelectPic(inPid); MakeRoi(1,1,width-2,height-2); SelectPic(outPid); MakeRoi(1,1,width-2,height-2); Dilate8Mark(inPid, outPid, t); Dilate8Mark(outPid, inPid, t); Dilate8Mark(inPid, outPid, t); Dilate8Mark(outPid, inPid, t); Dilate8Mark(inPid, outPid, t); Dilate8Mark(outPid, inPid, t); Dilate8Mark(inPid, outPid, t); Dilate8Mark(outPid, inPid, t); Dispose; end; macro 'Dilate16u front image repeatedly'; var height,width, inPid, outPid: integer; begin requiresUser('markup',1); t := GetNumber('thresh',t); inpid := pidNumber; GetPicSize(width,height); SaveState; SetNewSize(width,height); MakeNewWindow('Dilated ',inpid:0); outPid := pidNumber; RestoreState; SelectPic(inPid); MakeRoi(2,1,width-4,height-2); SelectPic(outPid); MakeRoi(2,1,width-4,height-2); Dilate16uMark(inPid, outPid, t); Dilate16uMark(outPid, inPid, t); Dilate16uMark(inPid, outPid, t); Dilate16uMark(outPid, inPid, t); Dilate16uMark(inPid, outPid, t); Dilate16uMark(outPid, inPid, t); Dilate16uMark(inPid, outPid, t); Dilate16uMark(outPid, inPid, t); Dispose; end; macro 'Front image is data16 image'; begin dataPid := PidNumber; end; macro 'Select All Inset'; begin SelectAll; InsetRoi(1); end; macro 'Select All Inset 16 bit'; var left, top, width, height: integer; begin SelectAll; GetPicSize(width,height); MakeRoi(2,1,width-4,height-2); end; macro 'SumMark16u or 16s'; var signed: Boolean; markPid, vectPid: Integer; left, top, width, height: integer; mleft, mtop, mwidth, mheight: integer; begin signed := GetNumber('enter 1 to calculate signed sum',0); markPid := PidNumber; choosePic(dataPid); GetRoi(left,top,width,height); choosePic(markPid); GetRoi(mleft, mtop, mwidth, mheight); if mwidth = width then begin {16 bit mark image} SetNewSize(512,512); MakeNewWindow('Sum of data16 ',dataPid:0,' mark16 ',markPid:0); end else begin if mwidth = width div 2 then begin {8 bit mark image} SetNewSize(32,32); MakeNewWindow('Sum of data16 ',dataPid:0,' mark8 ',markPid:0); end else begin PutMessage('mark width does not match data width'); exit; end;end; vectPid := PidNumber; if signed then Sum16sMark(dataPid, markPid, vectPid) else Sum16uMark(dataPid, markPid, vectPid); end;